<%-- 
    Document   : nuevaFacturaElectricidad
    Created on : 09-jul-2009, 17:22:12
    Author     : Alberto
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" session="false" import="domain.*, planner.*, java.util.*,dao.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>DOMECO</title>
        <link href="style.css" rel="stylesheet" type="text/css">

            <style type="text/css">@import url(./js/calendar-blue2.css);</style>
        <script type="text/javascript" src="./js/calendar.js"></script>
        <script type="text/javascript" src="./js/calendar-es.js"></script>
        <script type="text/javascript" src="./js/calendar-setup.js"></script>

            <script type="text/javascript">
//inicializo el calendario
window.onload = function() {
  Calendar.setup({
    inputField: "from",
    ifFormat:  "%Y-%m-%d",
    button:     "mas1"
  });

  Calendar.setup({
    inputField: "to",
    ifFormat:  "%Y-%m-%d",
    button:     "mas2"
  });

}
</script>
    </head>
    <body>
        
        <%if (request.getSession(false) != null) {%>
        <table align="center" width="1000" border="0">
            <tr>
                <td>
                    <div id="menu" align="center"><jsp:include page="./menu principal.jsp"></jsp:include></div>
                    <br>
                    <p id="campoAzul" align="center" valign="middle" width="235px"><span id="blanco">Electricidad</span><br></p>
                    <span id="azul"> Nueva Factura de Electricidad</span>
                    <div id="general">
                        <div id="cuenta" align="right" >
                            <form name="introducirCuenta" action="./Register?type=electricityConsumption&redir=E" method="post">
                                <table>
                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span id="azul">Contrato asociado:</span></td>
                                        <td><select name="elecon" id="elecon">
                                                <%
    Userdom u = (Userdom) request.getSession().getAttribute("user");
    Iterator it = new Operations().getElecContrList(u).iterator();
    while (it.hasNext()) {
        Electricitycontract e = (Electricitycontract) it.next();

                                                %>
                                                <option  value="<% out.print(e.getIdElectricityContract());%>"><% out.print(e.getContract().getNameContract());%></option>

                                                <%
    }
                                                %>


                                        </select></td>
                                    </tr>

                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span id="azul">Cantidad del consumo:</span></td>
                                        <td><input name="amount" type="text" value=""/></td>
                                        <td><address id="azul">Ejemplo:(125.24)</address></td>
                                    </tr>

                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span id="azul">Fecha de Inicio del consumo:</span></td>
                                        <td><input name="from" id="from" class="from" type="text" value="" readonly="readonly"/></td>
                                        <td><button name="mas1" id="mas1" class="mas1"></button></td>
                                        <td><address id="azul">(AAAA-MM-DD)</address></td>
                                    </tr>
                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span id="azul">Fecha Final del consumo:</span></td>
                                        <td><input name="to" id="to" class="to" type="text" value="" readonly="readonly"/></td>
                                        <td><button name="mas2" id="mas2" class="mas2"></button></td>
                                        <td><address id="azul">(AAAA-MM-DD)</address></td>
                                    </tr>


                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    
                                    <tr align="center">

                                        <td><input name="aceptar" type="submit" value="" id="aceptar"></td>
                                        <td><input type="button" value="" id="atras" onclick="javascript:history.back();"></td>
                                    </tr>

                                </table>
<br><br><br><br><br><br>
                            </form>
                        </div>
                    </div>

                    <div id="abajo" align="center"><p>&copy;   Domeco &mdash; Proyecto Informático A&ntilde;o 2009 </p></div>
                </td>
            </tr>
        </table>
        <%} else {%>
        <jsp:forward page="./index.jsp"></jsp:forward>
        <%}%>
    </body>
</html>
